package cn.cimoc.constant;



public enum ErrorEnum {

    /**
     * TODO
     */
    SUCCESS(2000, "成功"),

    BAD_REQUEST(400, "请求无效，请检查参数是否正确"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),

    VERIFICATION_CODE_GENERATION_FAILED(4000, "验证码生成失败"),
    VERIFICATION_CODE_MUST_BE_FILLED(4001, "验证码不能为空"),
    VERIFICATION_CODE_HAS_EXPIRED(4002, "验证码已过期"),
    VERIFICATION_CODE_ERROR(4003, " 验证码错误"),
    USER_DOES_NOT_EXIST(4004, "用户不存在"),
    WRONG_PASSWORD(4005, "密码错误"),
    LOGIN_EXPIRED(4006, "登录已过期，请重新登录"),
    USERNAME_ALREADY_EXISTS(4007, "用户名已存在"),
    FILE_UPLOAD_FAILED_OF_NAME_ILLEGAL(4008, "文件名异常"),
    IMG_FILE_TYPE_ERROR(4009, "图片文件格式错误"),
    FILE_UPLOAD_FAILED_WITH_UNKNOWN_EXCEPTION(4009, "文件上传未知错误"),

    UNKNOWN_ERROR(500, "未知错误，请联系管理员");


    private int code;
    private String msg;

    ErrorEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}